/*
* 该文件由工具生成，请勿更改
* 创建时间：2018-5-24 15:20:03
**/
using System;
using System.Collections.Generic;
using System.Linq;
using Pacs.Services.Soa;
using System.Text;
using System.Threading.Tasks;
namespace Pacs.Services.Server.XT_YongHuDengLu
{
     public partial  class XT_YongHuDengLu:ServiceBase
     {
        /// <summary>
        /// 在这里返回 验证码  等 
        /// 矫正信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
          public DTOResponse<XT_YongHuDengLuResponseParam> Excute(XT_YongHuDengLuRequest request)
          {
              var menus = new List<Pacs.Model.XT_SystemMenu>();
              var loginUserbll = new Pacs.BLL.XT_SystemLoginInfo();
              var userInfoBll = new Pacs.BLL.JC_SystemUserInfo();
              var loginInfo = loginUserbll.GetModelByDengLuMing(request.Body.DengLuMing);
              if(loginInfo==null)
              {
                  return new DTOResponse<XT_YongHuDengLuResponseParam>(false,"用户名不正确！");
              }
              var userinfo = userInfoBll.GetModel(loginInfo.YongHuID);
              if(loginInfo.DengLuMiMa!=request.Body.DengLuMiMa)//密码解密  没实现
              {
                return new DTOResponse<XT_YongHuDengLuResponseParam>(false, "密码不正确！");
              }
              if(loginInfo.YongHuLeiXing=="sa")//超管
              {
                  var menubll = new Pacs.BLL.XT_SystemMenu();
                  menus= menubll.GetModelList("0=0");
                  var para = new XT_YongHuDengLuResponseParam()
                  {
                      JC_SystemUserInfo=userinfo,
                      Menus=menus
                  };
                //Soa.Publishs.Publisher.Init();
                // Soa.Publishs.Publisher.Publish("", "Test", "AAA"); 
                return new DTOResponse<XT_YongHuDengLuResponseParam>(para);
              }
              else
              {
                  var menubll = new Pacs.BLL.XT_SystemMenu();
                  menus = menubll.GetModelList("0=0");
                  var para = new XT_YongHuDengLuResponseParam()
                  {
                      JC_SystemUserInfo = userinfo,
                      Menus = menus
                  };
                //Soa.Publishs.Publisher.Init();
                //Soa.Publishs.Publisher.Publish("", "Test", "AAA"); 
                return new DTOResponse<XT_YongHuDengLuResponseParam>(para);
              }
                 


          }
      }
}
